<!--用户操作弹窗-->
<ng-template #modalContent>
    <nz-spin [nzSpinning]="modalLoadingState">
        <form nz-form [formGroup]="dataForm" nzLayout="vertical">
            <div nz-row [nzGutter]="24">
                <div nz-col nzSpan="24" *ngIf='deptTree.length != 0'>
                    <nz-form-item>
                        <nz-form-label nzRequired>上级部门</nz-form-label>
                        <nz-form-control [nzErrorTip]="errorNameTpl">
                            <input *ngIf='false' nz-input [(ngModel)]="entity.parentId" formControlName="parentId" placeholder="请输入10个字符以内的真实姓名" />
                            <app-tree-select [tree]="deptTree" [(id)]="entity.parentId"></app-tree-select>
                        </nz-form-control>
                        <ng-template #errorNameTpl let-control>
                            <ng-container *ngIf="control.hasError('required')">不能为空</ng-container>
                        </ng-template>
                    </nz-form-item>
                </div>
                <div nz-col nzSpan="12">
                    <nz-form-item>
                        <nz-form-label nzRequired>部门名称</nz-form-label>
                        <nz-form-control [nzErrorTip]="errorNameTpl">
                            <input nz-input [(ngModel)]="entity.deptName" formControlName="deptName" placeholder="请输入部门名称" />
                            <ng-template #errorNameTpl let-control>
                                <ng-container *ngIf="control.hasError('required')">不能为空</ng-container>
                            </ng-template>
                        </nz-form-control>
                    </nz-form-item>
                </div>

                <div nz-col nzSpan="12">
                    <nz-form-item>
                        <nz-form-label nzRequired>部门排序</nz-form-label>
                        <nz-form-control [nzErrorTip]="errorNameTpl">
                            <input nz-input type='number' [(ngModel)]="entity.orderNum" formControlName="orderNum" placeholder="请输入部门排序" />
                            <ng-template #errorNameTpl let-control>
                                <ng-container *ngIf="control.hasError('required')">角色顺序不能为空</ng-container>
                            </ng-template>
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col nzSpan="12">
                    <nz-form-item>
                        <nz-form-label>负责人</nz-form-label>
                        <nz-form-control [nzErrorTip]="errorNameTpl">
                            <input nz-input [(ngModel)]="entity.leader" formControlName="leader" placeholder="请输入负责人" />
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col nzSpan="12">
                    <nz-form-item>
                        <nz-form-label>联系电话</nz-form-label>
                        <nz-form-control [nzErrorTip]="errorNameTpl">
                            <input nz-input [(ngModel)]="entity.phone" formControlName="phone" placeholder="请输入联系电话" />
                        </nz-form-control>
                    </nz-form-item>
                </div>

                <div nz-col nzSpan="12">
                    <nz-form-item>
                        <nz-form-label>邮箱</nz-form-label>
                        <nz-form-control [nzErrorTip]="errorNameTpl">
                            <input nz-input [(ngModel)]="entity.email" formControlName="email" placeholder="请输入10个字符以内的真实姓名" />
                        </nz-form-control>
                    </nz-form-item>
                </div>

                <div nz-col nzSpan="12">
                    <nz-form-item>
                        <nz-form-label>岗位状态</nz-form-label>
                        <nz-form-control>
                            <nz-radio-group [(ngModel)]="entity.status"  nzButtonStyle="solid" formControlName='status'>
                                <label nz-radio-button  nzValue="0">正常</label>
                                <label nz-radio-button  nzValue="1">停用</label>
                            </nz-radio-group>
                        </nz-form-control>
                    </nz-form-item>
                </div>
            </div>
        </form>
    </nz-spin>
</ng-template>
<ng-template #modalFooter>
    <button nz-button nzType="primary" [disabled]="dataForm.invalid" [nzLoading]="saveLoadingState" (click)="onSaveUser()">
        保存
    </button>
</ng-template>

